
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>规范 · TypeScript Handbook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Patrick Zhong">
        
        
    
    <link rel="stylesheet" href="../../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="By Example.html" />
    
    
    <link rel="prev" href="Library Structures.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../../">
            
                <a href="../../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../tutorials/">
            
                <a href="../tutorials/">
            
                    
                    快速上手
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../tutorials/TypeScript in 5 minutes.html">
            
                <a href="../tutorials/TypeScript in 5 minutes.html">
            
                    
                    5分钟了解TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../tutorials/ASP.NET Core.html">
            
                <a href="../tutorials/ASP.NET Core.html">
            
                    
                    ASP.NET Core
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../tutorials/ASP.NET 4.html">
            
                <a href="../tutorials/ASP.NET 4.html">
            
                    
                    ASP.NET 4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../tutorials/Gulp.html">
            
                <a href="../tutorials/Gulp.html">
            
                    
                    Gulp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../tutorials/Knockout.html">
            
                <a href="../tutorials/Knockout.html">
            
                    
                    Knockout.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../tutorials/React & Webpack.html">
            
                <a href="../tutorials/React & Webpack.html">
            
                    
                    React与webpack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../tutorials/React.html">
            
                <a href="../tutorials/React.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../tutorials/Angular 2.html">
            
                <a href="../tutorials/Angular 2.html">
            
                    
                    Angular 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="../tutorials/Migrating from JavaScript.html">
            
                <a href="../tutorials/Migrating from JavaScript.html">
            
                    
                    从JavaScript迁移到TypeScript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../">
            
                <a href="../">
            
                    
                    手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Basic Types.html">
            
                <a href="../Basic Types.html">
            
                    
                    基础类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Variable Declarations.html">
            
                <a href="../Variable Declarations.html">
            
                    
                    变量声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../Interfaces.html">
            
                <a href="../Interfaces.html">
            
                    
                    接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../Classes.html">
            
                <a href="../Classes.html">
            
                    
                    类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../Functions.html">
            
                <a href="../Functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../Generics.html">
            
                <a href="../Generics.html">
            
                    
                    泛型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../Enums.html">
            
                <a href="../Enums.html">
            
                    
                    枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../Type Inference.html">
            
                <a href="../Type Inference.html">
            
                    
                    类型推论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../Type Compatibility.html">
            
                <a href="../Type Compatibility.html">
            
                    
                    类型兼容性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../Advanced Types.html">
            
                <a href="../Advanced Types.html">
            
                    
                    高级类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../Utilit Types.md">
            
                <span>
            
                    
                    实用工具类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="../Symbols.html">
            
                <a href="../Symbols.html">
            
                    
                    Symbols
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="../Iterators and Generators.html">
            
                <a href="../Iterators and Generators.html">
            
                    
                    Iterators 和 Generators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="../Modules.html">
            
                <a href="../Modules.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.15" data-path="../Namespaces.html">
            
                <a href="../Namespaces.html">
            
                    
                    命名空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.16" data-path="../Namespaces and Modules.html">
            
                <a href="../Namespaces and Modules.html">
            
                    
                    命名空间和模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.17" data-path="../Module Resolution.html">
            
                <a href="../Module Resolution.html">
            
                    
                    模块解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.18" data-path="../Declaration Merging.html">
            
                <a href="../Declaration Merging.html">
            
                    
                    声明合并
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.19" data-path="../Writing Definition Files.html">
            
                <a href="../Writing Definition Files.html">
            
                    
                    书写.d.ts文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.20" data-path="../JSX.html">
            
                <a href="../JSX.html">
            
                    
                    JSX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.21" data-path="../Decorators.html">
            
                <a href="../Decorators.html">
            
                    
                    Decorators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.22" data-path="../Mixins.html">
            
                <a href="../Mixins.html">
            
                    
                    混入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.23" data-path="../Triple-Slash Directives.html">
            
                <a href="../Triple-Slash Directives.html">
            
                    
                    三斜线指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.24" data-path="../Type Checking JavaScript Files.html">
            
                <a href="../Type Checking JavaScript Files.html">
            
                    
                    JavaScript文件里的类型检查
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="Introduction.html">
            
                <a href="Introduction.html">
            
                    
                    如何书写声明文件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="Library Structures.html">
            
                <a href="Library Structures.html">
            
                    
                    结构
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.2" data-path="Do's and Don'ts.html">
            
                <a href="Do's and Don'ts.html">
            
                    
                    规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="By Example.html">
            
                <a href="By Example.html">
            
                    
                    举例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="Deep Dive.html">
            
                <a href="Deep Dive.html">
            
                    
                    深入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="Publishing.html">
            
                <a href="Publishing.html">
            
                    
                    发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="Consumption.html">
            
                <a href="Consumption.html">
            
                    
                    使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../tsconfig.json.html">
            
                <a href="../tsconfig.json.html">
            
                    
                    工程配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../tsconfig.json.html">
            
                <a href="../tsconfig.json.html">
            
                    
                    tsconfig.json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Project References.html">
            
                <a href="../Project References.html">
            
                    
                    工程引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../Typings for NPM Packages.html">
            
                <a href="../Typings for NPM Packages.html">
            
                    
                    NPM包的类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../Compiler Options.html">
            
                <a href="../Compiler Options.html">
            
                    
                    编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../Configuring Watch.html">
            
                <a href="../Configuring Watch.html">
            
                    
                    配置 Watch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../Compiler Options in MSBuild.html">
            
                <a href="../Compiler Options in MSBuild.html">
            
                    
                    在MSBuild里使用编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../Integrating with Build Tools.html">
            
                <a href="../Integrating with Build Tools.html">
            
                    
                    与其它构建工具整合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../Nightly Builds.html">
            
                <a href="../Nightly Builds.html">
            
                    
                    使用TypeScript的每日构建版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../../wiki/">
            
                <a href="../../wiki/">
            
                    
                    Wiki
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../wiki/this-in-TypeScript.html">
            
                <a href="../../wiki/this-in-TypeScript.html">
            
                    
                    TypeScript里的this
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../../wiki/coding_guidelines.html">
            
                <a href="../../wiki/coding_guidelines.html">
            
                    
                    编码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../../wiki/Common Errors.html">
            
                <a href="../../wiki/Common Errors.html">
            
                    
                    常见编译错误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../../wiki/TypeScript-Editor-Support.html">
            
                <a href="../../wiki/TypeScript-Editor-Support.html">
            
                    
                    支持TypeScript的编辑器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                <a href="../../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                    
                    结合ASP.NET v5使用TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../../wiki/Architectural-Overview.html">
            
                <a href="../../wiki/Architectural-Overview.html">
            
                    
                    架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../../wiki/Roadmap.html">
            
                <a href="../../wiki/Roadmap.html">
            
                    
                    发展路线图
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../../release-notes/">
            
                <a href="../../release-notes/">
            
                    
                    新增功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../../release-notes/TypeScript 3.1.html">
            
                <a href="../../release-notes/TypeScript 3.1.html">
            
                    
                    TypeScript 3.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../../release-notes/TypeScript 3.0.html">
            
                <a href="../../release-notes/TypeScript 3.0.html">
            
                    
                    TypeScript 3.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../../release-notes/TypeScript 2.9.html">
            
                <a href="../../release-notes/TypeScript 2.9.html">
            
                    
                    TypeScript 2.9
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../../release-notes/TypeScript 2.8.html">
            
                <a href="../../release-notes/TypeScript 2.8.html">
            
                    
                    TypeScript 2.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../../release-notes/TypeScript 2.7.html">
            
                <a href="../../release-notes/TypeScript 2.7.html">
            
                    
                    TypeScript 2.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../../release-notes/TypeScript 2.6.html">
            
                <a href="../../release-notes/TypeScript 2.6.html">
            
                    
                    TypeScript 2.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../../release-notes/TypeScript 2.5.html">
            
                <a href="../../release-notes/TypeScript 2.5.html">
            
                    
                    TypeScript 2.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../../release-notes/TypeScript 2.4.html">
            
                <a href="../../release-notes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="../../release-notes/TypeScript 2.3.html">
            
                <a href="../../release-notes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="../../release-notes/TypeScript 2.2.html">
            
                <a href="../../release-notes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="../../release-notes/TypeScript 2.1.html">
            
                <a href="../../release-notes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="../../release-notes/TypeScript 2.0.html">
            
                <a href="../../release-notes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.13" data-path="../../release-notes/TypeScript 1.8.html">
            
                <a href="../../release-notes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.14" data-path="../../release-notes/TypeScript 1.7.html">
            
                <a href="../../release-notes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.15" data-path="../../release-notes/TypeScript 1.6.html">
            
                <a href="../../release-notes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.16" data-path="../../release-notes/TypeScript 1.5.html">
            
                <a href="../../release-notes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.17" data-path="../../release-notes/TypeScript 1.4.html">
            
                <a href="../../release-notes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.18" data-path="../../release-notes/TypeScript 1.3.html">
            
                <a href="../../release-notes/TypeScript 1.3.html">
            
                    
                    TypeScript 1.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.19" data-path="../../release-notes/TypeScript 1.1.html">
            
                <a href="../../release-notes/TypeScript 1.1.html">
            
                    
                    TypeScript 1.1
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../../breaking-changes/breaking-changes.html">
            
                <a href="../../breaking-changes/breaking-changes.html">
            
                    
                    Breaking Changes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../../breaking-changes/TypeScript 2.4.html">
            
                <a href="../../breaking-changes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../../breaking-changes/TypeScript 2.3.html">
            
                <a href="../../breaking-changes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../../breaking-changes/TypeScript 2.2.html">
            
                <a href="../../breaking-changes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../../breaking-changes/TypeScript 2.1.html">
            
                <a href="../../breaking-changes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../../breaking-changes/TypeScript 2.0.html">
            
                <a href="../../breaking-changes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../../breaking-changes/TypeScript 1.8.html">
            
                <a href="../../breaking-changes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../../breaking-changes/TypeScript 1.7.html">
            
                <a href="../../breaking-changes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../../breaking-changes/TypeScript 1.6.html">
            
                <a href="../../breaking-changes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../../breaking-changes/TypeScript 1.5.html">
            
                <a href="../../breaking-changes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../../breaking-changes/TypeScript 1.4.html">
            
                <a href="../../breaking-changes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../.." >规范</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x666E;&#x901A;&#x7C7B;&#x578B;">&#x666E;&#x901A;&#x7C7B;&#x578B;</h1>
<h2 id="number&#xFF0C;string&#xFF0C;boolean&#x548C;object"><code>Number</code>&#xFF0C;<code>String</code>&#xFF0C;<code>Boolean</code>&#x548C;<code>Object</code></h2>
<p><em>&#x4E0D;&#x8981;</em>&#x4F7F;&#x7528;&#x5982;&#x4E0B;&#x7C7B;&#x578B;<code>Number</code>&#xFF0C;<code>String</code>&#xFF0C;<code>Boolean</code>&#x6216;<code>Object</code>&#x3002;
&#x8FD9;&#x4E9B;&#x7C7B;&#x578B;&#x6307;&#x7684;&#x662F;&#x975E;&#x539F;&#x59CB;&#x7684;&#x88C5;&#x76D2;&#x5BF9;&#x8C61;&#xFF0C;&#x5B83;&#x4EEC;&#x51E0;&#x4E4E;&#x6CA1;&#x5728;JavaScript&#x4EE3;&#x7801;&#x91CC;&#x6B63;&#x786E;&#x5730;&#x4F7F;&#x7528;&#x8FC7;&#x3002;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* &#x9519;&#x8BEF; */</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">reverse</span>(<span class="hljs-params">s: <span class="hljs-built_in">String</span></span>): <span class="hljs-title">String</span></span>;
</code></pre>
<p><em>&#x5E94;&#x8BE5;</em>&#x4F7F;&#x7528;&#x7C7B;&#x578B;<code>number</code>&#xFF0C;<code>string</code>&#xFF0C;and <code>boolean</code>&#x3002;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* OK */</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">reverse</span>(<span class="hljs-params">s: <span class="hljs-built_in">string</span></span>): <span class="hljs-title">string</span></span>;
</code></pre>
<p>&#x4F7F;&#x7528;&#x975E;&#x539F;&#x59CB;&#x7684;<code>object</code>&#x7C7B;&#x578B;&#x6765;&#x4EE3;&#x66FF;<code>Object</code> &#xFF08;<a href="../../release-notes/TypeScript%202.2.md#object-type">TypeScript 2.2&#x65B0;&#x589E;</a>&#xFF09;</p>
<h2 id="&#x6CDB;&#x578B;">&#x6CDB;&#x578B;</h2>
<p><em>&#x4E0D;&#x8981;</em>&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;&#x4ECE;&#x6765;&#x6CA1;&#x4F7F;&#x7528;&#x8FC7;&#x5176;&#x7C7B;&#x578B;&#x53C2;&#x6570;&#x7684;&#x6CDB;&#x578B;&#x7C7B;&#x578B;&#x3002;
&#x4E86;&#x89E3;&#x8BE6;&#x60C5;<a href="https://github.com/Microsoft/TypeScript/wiki/FAQ#why-doesnt-type-inference-work-on-this-interface-interface-foot---" target="_blank">TypeScript FAQ page</a>&#x3002;</p>
<!-- TODO: More -->
<h1 id="&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x7C7B;&#x578B;">&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x7C7B;&#x578B;</h1>
<h2 id="&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;">&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;</h2>
<!-- TODO: Reword; these examples make no sense in the context of a declaration file -->
<p><em>&#x4E0D;&#x8981;</em>&#x4E3A;&#x8FD4;&#x56DE;&#x503C;&#x88AB;&#x5FFD;&#x7565;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A;<code>any</code>&#x7C7B;&#x578B;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#xFF1A;</p>
<pre><code class="lang-ts">/* &#x9519;&#x8BEF; */
function fn(x: () =&gt; any) {
    x();
}
</code></pre>
<p><em>&#x5E94;&#x8BE5;</em>&#x7ED9;&#x8FD4;&#x56DE;&#x503C;&#x88AB;&#x5FFD;&#x7565;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x8BBE;&#x7F6E;<code>void</code>&#x7C7B;&#x578B;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#xFF1A;</p>
<pre><code class="lang-ts">/* OK */
function fn(x: () =&gt; void) {
    x();
}
</code></pre>
<p><em>&#x4E3A;&#x4EC0;&#x4E48;</em>&#xFF1A;&#x4F7F;&#x7528;<code>void</code>&#x76F8;&#x5BF9;&#x5B89;&#x5168;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x9632;&#x6B62;&#x4E86;&#x4F60;&#x4E0D;&#x5C0F;&#x5FC3;&#x4F7F;&#x7528;<code>x</code>&#x7684;&#x8FD4;&#x56DE;&#x503C;&#xFF1A;</p>
<pre><code class="lang-ts">function fn(x: () =&gt; void) {
    var k = x(); // oops! meant to do something else
    k.doSomething(); // error, but would be OK if the return type had been &apos;any&apos;
}
</code></pre>
<h2 id="&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x91CC;&#x7684;&#x53EF;&#x9009;&#x53C2;&#x6570;">&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x91CC;&#x7684;&#x53EF;&#x9009;&#x53C2;&#x6570;</h2>
<p><em>&#x4E0D;&#x8981;</em>&#x5728;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x91CC;&#x4F7F;&#x7528;&#x53EF;&#x9009;&#x53C2;&#x6570;&#x9664;&#x975E;&#x4F60;&#x771F;&#x7684;&#x8981;&#x8FD9;&#x4E48;&#x505A;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* &#x9519;&#x8BEF; */</span>
<span class="hljs-keyword">interface</span> Fetcher {
    getObject(done: (data: <span class="hljs-built_in">any</span>, elapsedTime?: <span class="hljs-built_in">number</span>) =&gt; <span class="hljs-built_in">void</span>): <span class="hljs-built_in">void</span>;
}
</code></pre>
<p>&#x8FD9;&#x91CC;&#x6709;&#x4E00;&#x79CD;&#x7279;&#x6B8A;&#x7684;&#x610F;&#x4E49;&#xFF1A;<code>done</code>&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x53EF;&#x80FD;&#x4EE5;1&#x4E2A;&#x53C2;&#x6570;&#x6216;2&#x4E2A;&#x53C2;&#x6570;&#x8C03;&#x7528;&#x3002;
&#x4EE3;&#x7801;&#x5927;&#x6982;&#x7684;&#x610F;&#x601D;&#x662F;&#x8BF4;&#x8FD9;&#x4E2A;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x4E0D;&#x5728;&#x4E4E;&#x662F;&#x5426;&#x6709;<code>elapsedTime</code>&#x53C2;&#x6570;&#xFF0C;
  &#x4F46;&#x662F;&#x4E0D;&#x9700;&#x8981;&#x628A;&#x8FD9;&#x4E2A;&#x53C2;&#x6570;&#x5F53;&#x6210;&#x53EF;&#x9009;&#x53C2;&#x6570;&#x6765;&#x8FBE;&#x5230;&#x6B64;&#x76EE;&#x7684; --
  &#x56E0;&#x4E3A;&#x603B;&#x662F;&#x5141;&#x8BB8;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x63A5;&#x6536;&#x8F83;&#x5C11;&#x53C2;&#x6570;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x3002;</p>
<p><em>&#x5E94;&#x8BE5;</em>&#x5199;&#x51FA;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x7684;&#x975E;&#x53EF;&#x9009;&#x53C2;&#x6570;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* OK */</span>
<span class="hljs-keyword">interface</span> Fetcher {
    getObject(done: (data: <span class="hljs-built_in">any</span>, elapsedTime: <span class="hljs-built_in">number</span>) =&gt; <span class="hljs-built_in">void</span>): <span class="hljs-built_in">void</span>;
}
</code></pre>
<h2 id="&#x91CD;&#x8F7D;&#x4E0E;&#x56DE;&#x8C03;&#x51FD;&#x6570;">&#x91CD;&#x8F7D;&#x4E0E;&#x56DE;&#x8C03;&#x51FD;&#x6570;</h2>
<p><em>&#x4E0D;&#x8981;</em>&#x56E0;&#x4E3A;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x53C2;&#x6570;&#x4E2A;&#x6570;&#x4E0D;&#x540C;&#x800C;&#x5199;&#x4E0D;&#x540C;&#x7684;&#x91CD;&#x8F7D;&#xFF1A;</p>
<pre><code class="lang-ts">/* &#x9519;&#x8BEF; */
declare function beforeAll(action: () =&gt; void, timeout?: number): void;
declare function beforeAll(action: (done: DoneFn) =&gt; void, timeout?: number): void;
</code></pre>
<p><em>&#x5E94;&#x8BE5;</em>&#x53EA;&#x4F7F;&#x7528;&#x6700;&#x5927;&#x53C2;&#x6570;&#x4E2A;&#x6570;&#x5199;&#x4E00;&#x4E2A;&#x91CD;&#x8F7D;&#xFF1A;</p>
<pre><code class="lang-ts">/* OK */
declare function beforeAll(action: (done: DoneFn) =&gt; void, timeout?: number): void;
</code></pre>
<p><em>&#x4E3A;&#x4EC0;&#x4E48;</em>&#xFF1A;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x603B;&#x662F;&#x53EF;&#x4EE5;&#x5FFD;&#x7565;&#x67D0;&#x4E2A;&#x53C2;&#x6570;&#x7684;&#xFF0C;&#x56E0;&#x6B64;&#x6CA1;&#x5FC5;&#x8981;&#x4E3A;&#x53C2;&#x6570;&#x5C11;&#x7684;&#x60C5;&#x51B5;&#x5199;&#x91CD;&#x8F7D;&#x3002;
&#x53C2;&#x6570;&#x5C11;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x9996;&#x5148;&#x5141;&#x8BB8;&#x9519;&#x8BEF;&#x7C7B;&#x578B;&#x7684;&#x51FD;&#x6570;&#x88AB;&#x4F20;&#x5165;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x4EEC;&#x5339;&#x914D;&#x7B2C;&#x4E00;&#x4E2A;&#x91CD;&#x8F7D;&#x3002;</p>
<h1 id="&#x51FD;&#x6570;&#x91CD;&#x8F7D;">&#x51FD;&#x6570;&#x91CD;&#x8F7D;</h1>
<h2 id="&#x987A;&#x5E8F;">&#x987A;&#x5E8F;</h2>
<p><em>&#x4E0D;&#x8981;</em>&#x628A;&#x4E00;&#x822C;&#x7684;&#x91CD;&#x8F7D;&#x653E;&#x5728;&#x7CBE;&#x786E;&#x7684;&#x91CD;&#x8F7D;&#x524D;&#x9762;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* &#x9519;&#x8BEF; */</span>
<span class="hljs-keyword">declare</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: <span class="hljs-built_in">any</span></span>): <span class="hljs-title">any</span></span>;
<span class="hljs-keyword">declare</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: HTMLElement</span>): <span class="hljs-title">number</span></span>;
<span class="hljs-keyword">declare</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: HTMLDivElement</span>): <span class="hljs-title">string</span></span>;

<span class="hljs-keyword">var</span> myElem: HTMLDivElement;
<span class="hljs-keyword">var</span> x = fn(myElem); <span class="hljs-comment">// x: any, wat?</span>
</code></pre>
<p><em>&#x5E94;&#x8BE5;</em>&#x6392;&#x5E8F;&#x91CD;&#x8F7D;&#x4EE4;&#x7CBE;&#x786E;&#x7684;&#x6392;&#x5728;&#x4E00;&#x822C;&#x7684;&#x4E4B;&#x524D;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* OK */</span>
<span class="hljs-keyword">declare</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: HTMLDivElement</span>): <span class="hljs-title">string</span></span>;
<span class="hljs-keyword">declare</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: HTMLElement</span>): <span class="hljs-title">number</span></span>;
<span class="hljs-keyword">declare</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: <span class="hljs-built_in">any</span></span>): <span class="hljs-title">any</span></span>;

<span class="hljs-keyword">var</span> myElem: HTMLDivElement;
<span class="hljs-keyword">var</span> x = fn(myElem); <span class="hljs-comment">// x: string, :)</span>
</code></pre>
<p><em>&#x4E3A;&#x4EC0;&#x4E48;</em>&#xFF1A;TypeScript&#x4F1A;&#x9009;&#x62E9;<em>&#x7B2C;&#x4E00;&#x4E2A;&#x5339;&#x914D;&#x5230;&#x7684;&#x91CD;&#x8F7D;</em>&#x5F53;&#x89E3;&#x6790;&#x51FD;&#x6570;&#x8C03;&#x7528;&#x7684;&#x65F6;&#x5019;&#x3002;
&#x5F53;&#x524D;&#x9762;&#x7684;&#x91CD;&#x8F7D;&#x6BD4;&#x540E;&#x9762;&#x7684;&#x201C;&#x666E;&#x901A;&#x201D;&#xFF0C;&#x90A3;&#x4E48;&#x540E;&#x9762;&#x7684;&#x88AB;&#x9690;&#x85CF;&#x4E86;&#x4E0D;&#x4F1A;&#x88AB;&#x8C03;&#x7528;&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;&#x53EF;&#x9009;&#x53C2;&#x6570;">&#x4F7F;&#x7528;&#x53EF;&#x9009;&#x53C2;&#x6570;</h2>
<p><em>&#x4E0D;&#x8981;</em>&#x4E3A;&#x4EC5;&#x5728;&#x672B;&#x5C3E;&#x53C2;&#x6570;&#x4E0D;&#x540C;&#x65F6;&#x5199;&#x4E0D;&#x540C;&#x7684;&#x91CD;&#x8F7D;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* &#x9519;&#x8BEF; */</span>
<span class="hljs-keyword">interface</span> Example {
    diff(one: <span class="hljs-built_in">string</span>): <span class="hljs-built_in">number</span>;
    diff(one: <span class="hljs-built_in">string</span>, two: <span class="hljs-built_in">string</span>): <span class="hljs-built_in">number</span>;
    diff(one: <span class="hljs-built_in">string</span>, two: <span class="hljs-built_in">string</span>, three: <span class="hljs-built_in">boolean</span>): <span class="hljs-built_in">number</span>;
}
</code></pre>
<p><em>&#x5E94;&#x8BE5;</em>&#x5C3D;&#x53EF;&#x80FD;&#x4F7F;&#x7528;&#x53EF;&#x9009;&#x53C2;&#x6570;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* OK */</span>
<span class="hljs-keyword">interface</span> Example {
    diff(one: <span class="hljs-built_in">string</span>, two?: <span class="hljs-built_in">string</span>, three?: <span class="hljs-built_in">boolean</span>): <span class="hljs-built_in">number</span>;
}
</code></pre>
<p>&#x6CE8;&#x610F;&#x8FD9;&#x5728;&#x6240;&#x6709;&#x91CD;&#x8F7D;&#x90FD;&#x6709;&#x76F8;&#x540C;&#x7C7B;&#x578B;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x65F6;&#x4F1A;&#x4E0D;&#x597D;&#x7528;&#x3002;</p>
<p><em>&#x4E3A;&#x4EC0;&#x4E48;</em>&#xFF1A;&#x6709;&#x4EE5;&#x4E0B;&#x4E24;&#x4E2A;&#x91CD;&#x8981;&#x539F;&#x56E0;&#x3002;</p>
<p>TypeScript&#x89E3;&#x6790;&#x7B7E;&#x540D;&#x517C;&#x5BB9;&#x6027;&#x65F6;&#x4F1A;&#x67E5;&#x770B;&#x662F;&#x5426;&#x67D0;&#x4E2A;&#x76EE;&#x6807;&#x7B7E;&#x540D;&#x80FD;&#x591F;&#x4F7F;&#x7528;&#x6E90;&#x7684;&#x53C2;&#x6570;&#x8C03;&#x7528;&#xFF0C;
  <em>&#x4E14;&#x5141;&#x8BB8;&#x5916;&#x6765;&#x53C2;&#x6570;</em>&#x3002;
&#x4E0B;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x66B4;&#x9732;&#x51FA;&#x4E00;&#x4E2A;bug&#xFF0C;&#x5F53;&#x7B7E;&#x540D;&#x88AB;&#x6B63;&#x786E;&#x7684;&#x4F7F;&#x7528;&#x53EF;&#x9009;&#x53C2;&#x6570;&#x4E66;&#x5199;&#x65F6;&#xFF1A;</p>
<pre><code class="lang-ts">function fn(x: (a: string, b: number, c: number) =&gt; void) { }
var x: Example;
// When written with overloads, OK -- used first overload
// When written with optionals, correctly an error
fn(x.diff);
</code></pre>
<p>&#x7B2C;&#x4E8C;&#x4E2A;&#x539F;&#x56E0;&#x662F;&#x5F53;&#x4F7F;&#x7528;&#x4E86;TypeScript&#x201C;&#x4E25;&#x683C;&#x68C0;&#x67E5;null&#x201D;&#x7279;&#x6027;&#x65F6;&#x3002;
&#x56E0;&#x4E3A;&#x6CA1;&#x6709;&#x6307;&#x5B9A;&#x7684;&#x53C2;&#x6570;&#x5728;JavaScript&#x91CC;&#x8868;&#x793A;&#x4E3A;<code>undefined</code>&#xFF0C;&#x901A;&#x5E38;&#x663E;&#x793A;&#x5730;&#x4E3A;&#x53EF;&#x9009;&#x53C2;&#x6570;&#x4F20;&#x5165;&#x4E00;&#x4E2A;<code>undefined</code>&#x3002;
&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x5728;&#x4E25;&#x683C;null&#x6A21;&#x5F0F;&#x4E0B;&#x53EF;&#x4EE5;&#x5DE5;&#x4F5C;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">var</span> x: Example;
<span class="hljs-comment">// When written with overloads, incorrectly an error because of passing &apos;undefined&apos; to &apos;string&apos;</span>
<span class="hljs-comment">// When written with optionals, correctly OK</span>
x.diff(<span class="hljs-string">&quot;something&quot;</span>, <span class="hljs-literal">true</span> ? <span class="hljs-literal">undefined</span> : <span class="hljs-string">&quot;hour&quot;</span>);
</code></pre>
<h2 id="&#x4F7F;&#x7528;&#x8054;&#x5408;&#x7C7B;&#x578B;">&#x4F7F;&#x7528;&#x8054;&#x5408;&#x7C7B;&#x578B;</h2>
<p><em>&#x4E0D;&#x8981;</em>&#x4E3A;&#x4EC5;&#x5728;&#x67D0;&#x4E2A;&#x4F4D;&#x7F6E;&#x4E0A;&#x7684;&#x53C2;&#x6570;&#x7C7B;&#x578B;&#x4E0D;&#x540C;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x5B9A;&#x4E49;&#x91CD;&#x8F7D;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* WRONG */</span>
<span class="hljs-keyword">interface</span> Moment {
    utcOffset(): <span class="hljs-built_in">number</span>;
    utcOffset(b: <span class="hljs-built_in">number</span>): Moment;
    utcOffset(b: <span class="hljs-built_in">string</span>): Moment;
}
</code></pre>
<p><em>&#x5E94;&#x8BE5;</em>&#x5C3D;&#x53EF;&#x80FD;&#x5730;&#x4F7F;&#x7528;&#x8054;&#x5408;&#x7C7B;&#x578B;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">/* OK */</span>
<span class="hljs-keyword">interface</span> Moment {
    utcOffset(): <span class="hljs-built_in">number</span>;
    utcOffset(b: <span class="hljs-built_in">number</span>|<span class="hljs-built_in">string</span>): Moment;
}
</code></pre>
<p>&#x6CE8;&#x610F;&#x6211;&#x4EEC;&#x6CA1;&#x6709;&#x8BA9;<code>b</code>&#x6210;&#x4E3A;&#x53EF;&#x9009;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;&#x7B7E;&#x540D;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#x4E0D;&#x540C;&#x3002;</p>
<p><em>&#x4E3A;&#x4EC0;&#x4E48;</em>&#xFF1A;This is important for people who are &quot;passing through&quot; a value to your function:</p>
<pre><code class="lang-ts"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: <span class="hljs-built_in">string</span></span>): <span class="hljs-title">void</span></span>;
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: <span class="hljs-built_in">number</span></span>): <span class="hljs-title">void</span></span>;
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params">x: <span class="hljs-built_in">number</span>|<span class="hljs-built_in">string</span></span>) </span>{
    <span class="hljs-comment">// When written with separate overloads, incorrectly an error</span>
    <span class="hljs-comment">// When written with union types, correctly OK</span>
    <span class="hljs-keyword">return</span> moment().utcOffset(x);
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Library Structures.html" class="navigation navigation-prev " aria-label="Previous page: 结构">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="By Example.html" class="navigation navigation-next " aria-label="Next page: 举例">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"规范","level":"1.4.2","depth":2,"next":{"title":"举例","level":"1.4.3","depth":2,"path":"doc/handbook/declaration files/By Example.md","ref":"./doc/handbook/declaration files/By Example.md","articles":[]},"previous":{"title":"结构","level":"1.4.1","depth":2,"path":"doc/handbook/declaration files/Library Structures.md","ref":"./doc/handbook/declaration files/Library Structures.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Patrick Zhong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"preface.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"TypeScript Handbook","language":"zh-hans","gitbook":">3.0.0","description":"Translation of official TypeScript Handbook"},"file":{"path":"doc/handbook/declaration files/Do's and Don'ts.md","mtime":"2018-10-13T09:48:54.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-13T09:57:42.904Z"},"basePath":"../../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../../gitbook/gitbook.js"></script>
    <script src="../../../gitbook/theme.js"></script>
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

